<template>
	<view class="">
<!-- 		<view class="heightBox">

		</view> -->
<!-- 		<view class="myTabBar">
			<view class="tab-item" v-for="(item,index) in list">
				<view class="tab-img">

				</view>
				<view class="tab-text">
					{{item.title}}
				</view>
			</view>
		</view> -->

		<u-tabbar
			:value="value"
			@change="changeTab"
			:zIndex="9999"
		>
			<u-tabbar-item v-for="(item,index) in list" :text="item.title" :icon="item.icon"></u-tabbar-item>
		</u-tabbar>

	</view>

</template>

<script>
	export default {
		name:'customTabBar',
		data() {
			return {
				value: 0
			}
		},
		props:{
			list:{
				type: Array,
				default: []
			},
			currentIndex:{
			  type:Number,
        default:0
      }
		},
		created() {
			this.value = this.currentIndex
		},
		methods: {
			changeTab(e){
				this.value = e;
        console.log("=========e",e,this.list)
				uni.redirectTo({
					url: this.list[e].url
				});
			}
		}
	}
</script>

<style>
	.heightBox{
		height: 150rpx;
	}
	.myTabBar{
		display: flex;
		position: fixed;
		width: 100%;
		bottom: 0;
		padding: 30rpx 0;
		border-top: 1px solid #eee;
		z-index: 999;
		background-color: #fff;
	}
	.tab-item{
		flex: 1;
		text-align: center;
		display: flex;
		flex-direction: column;
		align-items: center;
		font-size: 28rpx;
	}
	.tab-img{
		width: 50rpx;
		height: 50rpx;
		background-color: #C0C0C0;
	}
</style>
